﻿<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="Transparent"
    FontSize="12" FontFamily="Segoe UI" PagePadding="2">
    <BlockUIContainer Background="Transparent">
        <BlockUIContainer.Resources>
            <Style TargetType="{x:Type TextBlock}">
                <Setter Property="TextWrapping" Value="Wrap"/>
            </Style>
        </BlockUIContainer.Resources>
        <StackPanel Background="Transparent">
            <TextBlock Text="{Binding DefinedWord}" FontWeight="Bold" FontSize="14" />
            <ListBox ItemsSource="{Binding Definitions}" Style="{StaticResource InvisibleListBox}" Margin="0" IsHitTestVisible="False"
                     ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}},Path=ActualWidth}">
                            <TextBlock Text="{Binding DefinitionType}" FontWeight="Bold"/>
                            <ListBox ItemsSource="{Binding Meanings}" IsEnabled="true" ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="2" IsHitTestVisible="False"
                                     Background="Transparent" Style="{StaticResource BulletedListBox}" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </StackPanel>
    </BlockUIContainer>
</FlowDocument>